// import enElement from 'element-ui/lib/locale/lang/en'

const en = {
  global: {
    username: 'Username',
    password: 'Password',
    username_input: 'Please input username!',
    password_input: 'Please input password!',
    rememberMe: 'Remember Me',
    forgetPwd: 'Forget Password',
    login: 'Login',
    loginBottomTip: 'Copyright ©Shanghai Magus Technology Co. Ltd All rights reserved',
    chinese: 'Chinese',
    en: 'English',
    default: 'Default',
    green: 'Green',
    red: 'Red',
    systemManagerLogin: 'System Manager Login',
    systemName: 'Cloud edge integration platform',
    magustek: 'magustek',
    more: 'More',
    user: 'User',
    userInfo: 'UserInfo',
    taskList: 'The task list',
    completeUserInfo: 'CompleteInfo',
    EditPassword: 'EditPassword',
    oldPassword: 'OldPassword',
    newPassword: 'NewPassword',
    checkNewPassword: 'Confirm password',
    newPasswordDiff: 'Two new passwords are different!',
    editPasswordSuccess: 'Password has been updated',
    needOldPwd: 'Place input old password',
    needNewPwd: 'Place input new password',
    needNewPwd2: 'Place confirm new password',
    userInfoDialog: {
      username: 'Username',
      orgCode: 'OrgCode',
      mobile: 'Mobile',
      email: 'Email',
      sysAdmin: 'SysAdmin',
      admin: 'Admin',
      type: 'Type',
      descs: 'Remark',
    },
    Exit: 'Exit',
    home: 'Operations center',
    allOrgCode: 'All',
    language: 'Language',
    theme: 'Theme',
    showLiftMenu: 'Display menu',
    hiddenLiftMenu: 'Hidden menu',
    openAllScreen: 'Full Screen',
    closeAllScreen: 'Exit Full Screen',
    exportHthml: 'Export HTML',
    importExcel: 'Import Excel',
    chooseFile: 'Select the file',
    tip: {
      excel_tip: 'Only XLSX files can be uploaded'
    },
    userLogin: {
      error: 'The account name and password do not match, please re-enter',
      userInfoError: 'Failed to get user information',
      orgCodeInfoError: 'Failed to get organization information',
      dictInfoError: 'Failed to get data dictionary information',
      menuInfoError: 'Failed to get menu information',
      usernameEmpty: 'The user name cannot be empty',
      passwordEmpty: 'The password cannot be empty'
    },
    action: {
      add: 'add',
      edit: 'edit',
      delete: 'delete',
      search: 'search',
      confirm: 'confirm',
      cancel: 'cancel',
      save: 'save',
      back: 'back',
      backHome: 'back home',
      packup: 'Pack Up',
      unfold: 'Unfold'
    },
    field: {
      No: 'No'
    },
    text: {
      choose: 'choose',
      success: 'success',
      error: 'error',
      delete: 'delete',
      notice: 'notice',
      total: 'total',
      itemPage: 'items，',
      currentPage: 'items/page，',
      page: 'page'
    },
    request: {
      errMsg_400: '400 error: Request failed!',
      errMsg_401: '401 error: Permission denied!',
      errMsg_403: '403 error: The server refused to execute this request!',
      errMsg_404: '404 error: No resources found!',
      errMsg_500: '500 error: system error!',
      errMsg_504: '504 error: Network request timeout!',
      errMsg_999: 'Session timeout!'
    },
    dialogTitle: {
      chooseIcon: 'Choose the icon'
    }
  }
}

/**
 * 获取全部的en文件
 */
function getAllenLangs() {
  let contexts = require.context('@', true, /^\.\/.*\/lang\/en\.js$/)
  contexts.keys().forEach((key) => {
    let func = contexts(key).default // 导出默认项
    if (typeof (func) !== 'undefined') {
      for (let obj in func) {
        en[obj] = func[obj]
      }
    }
  })
  return en
}

export default getAllenLangs()